import request from '@/utils/request'

// 查询全部车辆列表
export function listAllVehicle() {
  return request({
    url: '/vehicle/manage/listAll',
    method: 'get'
  })
}
// 分页查询车辆列表
export function listVehicle(query) {
  return request({
    url: '/vehicle/manage/pageList',
    method: 'get',
    params: query
  })
}

// 查询车辆管理详细
export function getVehicle(id) {
  return request({
    url: '/vehicle/manage/query/' + id,
    method: 'get'
  })
}

// 新增车辆管理
export function addVehicle(data) {
  return request({
    url: '/vehicle/manage/add',
    method: 'post',
    data: data
  })
}

// 修改车辆管理
export function updateVehicle(data) {
  return request({
    url: '/vehicle/manage/edit',
    method: 'put',
    data: data
  })
}

// 删除车辆管理
export function delVehicle(ids) {
  return request({
    url: '/vehicle/manage/remove/' + ids,
    method: 'delete'
  })
}

// 车辆状态批量更新为正常
export function updateVehicleStateToNormal(data) {
  return request({
    url: '/vehicle/manage/updateVehicleStateToNormal',
    method: 'post',
    data
  })
}

// 车辆状态批量更新为禁用
export function updateVehicleStateToAbort(data) {
  return request({
    url: '/vehicle/manage/updateVehicleStateToAbort',
    method: 'post',
    data
  })
}

// 车辆营业状态批量更新为休息中
export function updateBusinessStateToRest(data) {
  return request({
    url: '/vehicle/manage/updateBusinessStateToRest',
    method: 'post',
    data
  })
}

// 车辆营业状态批量更新为营业中
export function updateBusinessStateToOpen(data) {
  return request({
    url: '/vehicle/manage/updateBusinessStateToOpen',
    method: 'post',
    data
  })
}

